﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IUserManager.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the IUserRepository type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Business.Interfaces
{
    using Hisaab.Business.Entities;

    /// <summary>
    /// Defines the <seealso cref="Hisaab.Business.Interfaces.IUserManager"/> interface.
    /// </summary>
    public interface IUserManager : IManagerBase<User>
    {
        /// <summary>
        /// Validates the useer.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <returns>Id of user if authentication successful, -1 if authentication fails</returns>
        int ValidateUser(string username, string password);

        /// <summary>
        /// Changes the password.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="oldPassword">The old password.</param>
        /// <param name="newPassword">The new password.</param>
        /// <param name="confirmPassword">The confirm password.</param>
        /// <returns>
        /// True if the password is changed successfully, false otherwise
        /// </returns>
        bool ChangePassword(int userId, string oldPassword, string newPassword, string confirmPassword);

        /// <summary>
        /// Gets the secret question.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>Secret question of user</returns>
        string GetSecretQuestion(int userId);

        /// <summary>
        /// Updates the secret question.
        /// </summary>
        /// <param name="userId">The logged user.</param>
        /// <param name="secretQuestion">The secret question.</param>
        /// <param name="secretAnswer">The secret answer.</param>
        /// <returns>True if the update is successfully, false otherwise</returns>
        bool UpdateSecretQuestion(int userId, string secretQuestion, string secretAnswer);

        /// <summary>
        /// Gets the currency symbol.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>Locale of currency for user</returns>
        string GetCurrencySymbol(int userId);

        /// <summary>
        /// Sets the currency symbol.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="symbol">The locale.</param>
        /// <returns>True if the update is successfully, false otherwise</returns>
        bool SetCurrencySymbol(int userId, string symbol);
    }
}